﻿using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Net;
using System.Net.Http;
using System.Text;
using System.Web.Http;
using ybx_caller.entity;

namespace ybx_caller.controller
{
    public class ShareController : ApiController
    {
        public HttpResponseMessage PostYbCall([FromBody] object value)
        {
            Console.WriteLine("输入:"+ value.ToString());
            ShareData data =  JsonConvert.DeserializeObject<ShareData>(value.ToString());
            string start_date = data.body.start_date;
            string end_date = data.body.end_date;    
            string backData = ShareBackData.getData(start_date,end_date);
            var fff = Request.CreateResponse(HttpStatusCode.OK, backData);
            fff.Content = new StringContent(backData, Encoding.UTF8, "application/json");
            return fff;
        }
    }
}
